import styles from '../css/query.module.css'

function Item(props) {
  // console.log(props)

  return (
    <div className={styles.trainBox}>
      {/* 第一行 */}
      <span>发车 {props.startTime}</span>
      <span>
        {/* 始发站图标 */}
        <span
          className="iconfont icon-shifazhan"
          style={{ color: 'green', fontSize: 13, marginRight: 5 }}
        ></span>
        <span>{props.startStation}</span>
      </span>
      <span>{props.trainNo}</span>
      <span className={styles.colLast}>￥{props.ssoftSeat.price}</span>

      {/* 第二行 */}
      <span>到达 {props.endTime}</span>
      <span>
        <span
          className="iconfont icon-zhongdian"
          style={{
            color: 'green',
            fontSize: 12,
            marginRight: 5
          }}
        ></span>
        <span>{props.endStation}</span>
      </span>
      <span>耗时{props.timeTaken}</span>
      <span className={styles.colLast}>
        二等座：{props.ssoftSeat.ticketNum}
        {typeof props.ssoftSeat.ticketNum === 'number' && <span>张</span>}
      </span>
    </div>
  )
}

export default Item
